<?php

/**
 * Upgrade form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseUpgradeForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'upgrade_id'      => new sfWidgetFormInputHidden(),
      'from_product_id' => new sfWidgetFormInput(),
      'to_product_id'   => new sfWidgetFormInput(),
      'valid_from'      => new sfWidgetFormDateTime(),
      'valid_to'        => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'upgrade_id'      => new sfValidatorPropelChoice(array('model' => 'Upgrade', 'column' => 'upgrade_id', 'required' => false)),
      'from_product_id' => new sfValidatorInteger(array('required' => false)),
      'to_product_id'   => new sfValidatorInteger(array('required' => false)),
      'valid_from'      => new sfValidatorDateTime(array('required' => false)),
      'valid_to'        => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('upgrade[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Upgrade';
  }


}
